package com.woniu.woniu_bx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniu.woniu_bx.pojo.Perm;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author:GuoHai
 * @program: IntelliJ IDEA
 * @data: 2022/8/27 16:10
 */
public interface PermMapper extends BaseMapper<Perm> {
    /**
     * 根据角色id获取权限列表
     * @param id
     * @return
     */
    @Select("select * from bx_perm bp,bx_role_perm rp where rp.role_id=#{id} and rp.perm_id=bp.id")
    List<Perm> getListByRoleID(int id);

    @Select("select * from bx_perm")
    List<Perm> findAll();
}
